<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,
        body {
            margin: 0;
            /*这个难道要清除外边距吗？*/
            width: 100%;
            height: 100%;
        }
        
        body {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        div {
            width: 200px;
            height: 200px;
            background-color: #bfa;
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>